package com.dragon.modules.yuegou.mapper.coupon;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dragon.modules.yuegou.entity.coupon.CouponEntity;
import com.dragon.modules.yuegou.model.coupon.Coupon;
import com.dragon.modules.yuegou.model.coupon.CouponUserList;
import com.dragon.modules.yuegou.model.coupon.ReceiveDetail;
import com.dragon.modules.yuegou.query.coupon.AvailableCouponQuery;
import com.dragon.modules.yuegou.query.coupon.ReceiveDetailRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 优惠券（会员的优惠券，不冗余优惠券模板信息，请使用1+N模式查询） Mapper接口
 *
 * @author pbuilder generated
 * @date 2019-10-13 15:09:43
 * @version 2.0
 */
@Component("coupCouponMapper")
public interface CouponMapper extends BaseMapper<CouponEntity> {

	/**
	 * 列出可用的优惠券
	 * 
	 * @param query 可用优惠券查询条件
	 * @return 满足所有条件的可用优惠券
	 */
	List<Coupon> selectAvailableCouponList(@Param("query") AvailableCouponQuery query);

	/**
	 * 分页查询可用的优惠券
	 * 
	 * @param query 可用优惠券查询条件
	 * @return 满足所有条件的可用优惠券
	 */
	IPage<Coupon> selectAvailableCouponPage(IPage<CouponEntity> page, @Param("query") AvailableCouponQuery query);

	/**
	 * @param id 模板Id
	 * @param mobile 电话号码
	 * @return
	 */
	List<CouponUserList> couponUserList(@Param("id") String id, @Param("mobile") String mobile);

	/**
	 * @param page
	 * @param request
	 * @return
	 */
	IPage<ReceiveDetail> receiveDetail(IPage<ReceiveDetail> page, @Param("request") ReceiveDetailRequest request);

	/**
	 * @param request
	 * @return
	 */
	List<ReceiveDetail> receiveDetail(@Param("request") ReceiveDetailRequest request);

}
